import {
	ElMessage
} from 'element-plus'

import DF from '@/utils/dateFormat.js'

function $msgError(res) {
	console.log(res)
	ElMessage({
		type: 'error',
		message: res.data
	})
}

export default {
	install(vue) {
		//http
		const {
			$get,
			$post,
			BASE_URL,
			$POST,
			$download
		} = require('./request.js')
		vue.config.globalProperties.$get = $get
		vue.config.globalProperties.$post = $post
		vue.config.globalProperties.BASE_URL = BASE_URL
		vue.config.globalProperties.$POST = $POST
		vue.config.globalProperties.$download = $download
		
		//全局方法
		vue.config.globalProperties.$msgError = $msgError
		vue.config.globalProperties.$DF = DF
		
	}
}
